1. Technical Field
The present disclosure relates generally to user-defined functions, and more particularly to, temporal user-defined functions.
2. Related Art
A database is a collection of stored data that is logically related and that is accessible by one or more users or applications. A popular type of database is the relational database management system (RDBMS), which includes relational tables, also referred to as relations, made up of rows and columns (also referred to as tuples and attributes). Each row represents an occurrence of an entity defined by a table, with an entity being a person, place, thing, or other object about which the table contains information.
An RBDMS may be a temporal database that allows time-varying data to be maintained. Temporal databases store and query data with time-based qualities. Use of these time-based qualities allows users to produce the same query results even when the underlying data sources change. However, if a query contains a user-defined function (UDF), then the users have to ensure that the UDFs in use have not changed over the time, otherwise they may get different results or worse, unrecognized incorrect results. Without a mechanism to manage these changes, the DBS/user is tasked with keeping the UDF versions synchronized with the corresponding queries. For example, a UDF may calculate the weighted value of 20 different inputs. The weighting of each input is embedded in the UDF. Over time, the user needs to change the weighting and therefore must update the UDF algorithm with a new weighting scheme. To get the same result of a given query requires for a given time period requires the use of the appropriate version of the UDF for that time period.